
module.exports=function(success,error){
    const config=require('../config/config')
    const mongoose=require('mongoose')
    mongoose.connect(`mongodb://${config.DBHOST}:${config.DBPOST}/${config.DBNAME}`)
    mongoose.connection.once('open',()=>{
        success()
    })
    mongoose.connection.once('error',()=>{
        error()
    })
    mongoose.connection.once('close',()=>{
        console.log('关闭')
    })
}
